<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration {
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('user_plan', function (Blueprint $table) {
            $table->id();
            $table->integer('u_id')->index()->nullable(false)->comment('用户id');
            $table->tinyInteger('plan_type')->nullable(false)->default(0)->comment('计划类型: 0 今日待办 1 明日计划 3 周计划 4 月计划 5 年计划');
            $table->tinyInteger('type')->nullable(false)->default(0)->comment('类型: 0 待办 1完成 2未完成 3 开心 4 烦心的事 5 学到了什么 6 需要改进的');
            $table->tinyInteger('every_day')->nullable()->comment('是否每天重复');
            $table->text('content')->comment('内容');
            $table->string('un_finish_content')->nullable()->comment('未完成的事项');
            $table->string('un_finish_reason')->nullable()->comment(' 未完成的原因');
            $table->string('improvement_plan')->nullable()->comment('改进计划');
            $table->date('copy_date')->nullable()->comment('复制日期');
            $table->date('start_date')->nullable()->comment('开始日期');
            $table->date('end_date')->nullable()->comment('结束日期');
            $table->timestamps();
            $table->comment('计划');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('user_plan');
    }
};
